package site.hanzhe.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import site.hanzhe.interceptor.LoginInterceptor;

/**
 *  SpringMVC配置类
 *     视图解析器在spring-mvc中进行配置
 *     登录拦截交给SpringSecurity来处理
 *     这个配置类暂时废弃，，，
 */
//@Configuration
//@EnableWebMvc
public class MyWebMvcConfig implements WebMvcConfigurer {

    //// 配置JSP的视图解析器
    //@Override
    //public void configureViewResolvers(ViewResolverRegistry registry) {
    //    registry.jsp("/WEB-INF/", ".jsp");
    //}
    //
    //// 注册拦截器
    //@Override
    //public void addInterceptors(InterceptorRegistry registry) {
    //    // 登录的拦截器
    //    registry.addInterceptor(new LoginInterceptor())
    //            .addPathPatterns("/**")
    //            .excludePathPatterns("/admin/to/login/page.html")
    //            .excludePathPatterns("/admin/do/login.html")
    //            .excludePathPatterns("/admin/do/logout.html");
    //}

}